package com.bigmi.admin.controller;

import com.bigmi.admin.service.AdNewsService;
import com.bigmi.model.admin.dto.NewsAuthDto;
import com.bigmi.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/api/v1/news")
public class AdNewsController {
    @Autowired
    private AdNewsService adNewsService;

    @PostMapping("/list_vo")
    public ResponseResult listOv(@RequestBody NewsAuthDto newsAuthDto){
        return adNewsService.listOv(newsAuthDto);
    }
    @GetMapping("/one_vo/{id}")
    public ResponseResult oneOv(@PathVariable Integer id){
        return adNewsService.oneOv(id);
    }
    @PostMapping("/auth_fail")
    public ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto){
        return adNewsService.authFail(newsAuthDto);
    }
    @PostMapping("/auth_pass")
    public ResponseResult authPass(@RequestBody NewsAuthDto newsAuthDto){
        return adNewsService.authPass(newsAuthDto);
    }
}
